import request from '@/utils/request'

export function addCost(data) {
  return request({
    url: '/cost',
    method: 'post',
    data
  })
}

export function delCost(id) {
  return request({
    url: '/cost',
    method: 'delete',
    params: {
      id: id
    }
  })
}

export function modifyCost(id, data) {
  return request({
    url: '/cost',
    method: 'put',
    params: {
      id: id
    },
    data
  })
}

export function getCostList(params) {
  return request({
    url: '/cost',
    method: 'get',
    params
  })
}

export function getCostInfo(id) {
  return request({
    url: '/cost',
    method: 'get',
    params: {
      id: id
    }
  })
}

export function getCostEchartsData(time) {
  return request({
    url: '/cost/echartsData',
    method: 'get',
    params: {
      time: time
    }
  })
}
